/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apt.matrimony.methods;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import org.apt.matrimony.beans.AccountDetailBeans;
import org.apt.matrimony.db.MyConnection;

/**
 *
 * @author yoko
 */
public class Searchs {
 public static List selectAccountDetails(){
    List<AccountDetailBeans> list=new ArrayList();
    Connection cnn=null;
    PreparedStatement stm=null;
    ResultSet rs=null;
    String sql="Select * from Account_Details";
    try {
        cnn=MyConnection.openConnection();
        stm=cnn.prepareCall(sql);
        rs=stm.executeQuery();
        while(rs.next()){
            AccountDetailBeans bean=new AccountDetailBeans();
            bean.setAccount_Details_Id(rs.getInt("Account_Id"));
            list.add(bean);
        }
    } catch (Exception e) {
        System.out.println(e.getMessage());
    } finally{
        MyConnection.closeConnection(cnn, stm, rs);
    }
    return list;
}
}
